<include file="public@header" />
</head>

<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('company/apply_list')}">申请列表</a></li>
			<li class="active"><a href="javascript:;">{$company.company_name}申请信息详情</a></li>
		</ul>   

	</div>	
	<div class="col-md-10 col-md-offset-1">
		<table class="table table-bordered">
			<tbody>
				<tr>
					<td style="width: 200px;text-align: center;font-weight: 800;" >公司名称</td>
					<td>{$company.company_name}</td>
				</tr>
				<tr>
					<td style="width: 200px;text-align: center;font-weight: 800;" >所属行业</td>
					<td>{$company.type_name}</td>
				</tr>
				<tr>
					<td style="width: 200px;text-align: center;font-weight: 800;" >组织代码</td>
					<td>{$company.company_num}</td>
				</tr>
				<tr>
					<td style="width: 200px;text-align: center;font-weight: 800;" >申请时间</td>
					<td>{$company.create_time|date="Y年m月d日 H时i分s秒",###}</td>
				</tr>
				<tr>
					<td style="width: 200px;text-align: center;font-weight: 800;" >公司地址</td>
					<td>{$company.address}</td>
				</tr>
				<tr>
					<td style="width: 200px;text-align: center;font-weight: 800;" >公司电话</td>
					<td>{$company.tel}</td>
				</tr>
				<tr>
					<td style="width: 200px;text-align: center;font-weight: 800;" >公司网址</td>
					<td>{$company.url}</td>
				</tr>
				<tr>
					<td style="width: 200px;text-align: center;font-weight: 800;" >管理员账号</td>
					<td>{$user.user_login}</td>
				</tr>
				<tr>
					<td style="width: 200px;text-align: center;font-weight: 800;" >邮箱</td>
					<td>{$user.user_email}</td>
				</tr>
				<tr>
					<td style="width: 200px;text-align: center;font-weight: 800;" >电话</td>
					<td>{$user.mobile}</td>
				</tr>
				<tr>
					<td style="width: 200px;text-align: center;font-weight: 800;" >操作</td>
					<td><?php if($company['status']==2){ ?><a href="javascript:;" onclick="apply_deal(1);" class="btn btn-success">予以通过</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" onclick="apply_deal(3);" class="btn btn-danger">驳回申请</a><?php }else if($company['status']==3){ echo '<span style="color:red;">申请已驳回，未通过申请！</span>';}else if($company['status']==1){echo '<span style="color:green;">申通通过！</span>';} ?></td>
				</tr>
				<tr>
					<td style="width: 200px;text-align: center;font-weight: 800;" >备注</td>
					<td>{$company.remark}</td>
				</tr>
			</tbody>
		</table>	
	</div>
	<div id="remarks" style="display: none;">
		<div style="margin: 10px; ">
			<textarea name="remark" style="resize: none;width:100%;height: 180px;padding: 5px 10px;line-height: 20px;"></textarea>
		</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
    <script src="__STATIC__/js/layer/layer.js"></script>
    <script>
    	function apply_deal(status){    
    		var url="{:url('company/apply_deal')}";	
    		var id="{$company.id}";
    		//通过请求
    		if(status==1){
    			$.post(url,{status:status,id:id,remark:"申请通过！"},function(data){
                    		layer.msg(data.message);
                    		if(data.status="success"){
                    			window.location.reload();
                    		}
                    	});
                    	//驳回
    		}else{
    			    var index=layer.open({
                    type: 1,
                    title: '驳回理由',
                    area: ['500px', '300px'],
                    closeBtn: 1,
                    btn:['提交','取消'],
                    shadeClose: true,
                    skin: 'yourclass',
                    scrollbar: false,
                    content: $("#remarks "),
                    yes:function(){
                    	//提交
                    	var remark="驳回理由："+$('#remarks').find('textarea[name=remark]').val();
                    	$.post(url,{status:status,id:id,remark:remark},function(data){
                    		layer.msg(data.message);
                    		if(data.status="success"){
                    			window.location.reload();
                    		}
                    	});
                    }
       			});
    		}

        }
    </script>
</body>
</html>